package com.zxy.ziems.server.production.controller;

import com.zxy.ziems.server.production.pojo.param.ProductionTableParam;
import com.zxy.ziems.server.production.service.CustXyhShipService;
import com.zxy.ziems.server.vo.ChartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 出货量信息
 *
 * @Copyright (C),
 * @ClassName: CustXyhShipController
 * @Author: yanzhiwei
 * @Description:
 * @Date: 2024/5/13 16:29
 */
@RestController
@Validated
@RequestMapping("/api/producion/ship")
public class CustXyhShipController {


    /**
     * 出货量统计
     *
     * @param productionTableParam
     * @return
     */
    @GetMapping("/dateCount")
    public ChartVo typeCount(@Validated ProductionTableParam productionTableParam) {
        return service.CustXyhShipDataCompare(productionTableParam.getStart(), productionTableParam.getEnd(), productionTableParam.getQueryType());
    }

    private CustXyhShipService service;

    @Autowired
    public void setService(CustXyhShipService custXyhShipService) {
        this.service = custXyhShipService;
    }
}
